'use strict';
var fs = require('fs');
for (let i = 1; i < 101; i++) {
    fs.writeFileSync(i + ".txt",Math.floor(Math.random()*1000+1)+"");
}
let max = 0;
let name;
for (let a = 1; a < 101; a++) {
    let b = fs.readFileSync(a + ".txt");
    console.log(b.toString());
    if (Number(b.toString())>max) {
        max=Number(b.toString());
        name=a;
    }
}
setTimeout(function(){
    console.log(max);
    console.log(name);
}, 300);